/**
 * Created by wm123 on 2017/7/13.
 */
import client from 'board-game/client';
import './index.less';

import game from './game.vue';
import introduction from './introduction.vue';
import result from './result.vue';

Vue.config.keyCodes.w = 87;
Vue.config.keyCodes.a = 65;
Vue.config.keyCodes.s = 83;
Vue.config.keyCodes.d = 68;

client({
    components: {
        game, introduction, result
    }
}, ({ app, set }) => ({
    battle(battle) {
        set(app.game, 'battle', battle);
    }
}));

(function(){
    let bp = document.createElement('script');
    let curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    } else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    let s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
let _hmt = _hmt || [];
(function() {
    let hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?f9c31b8c32fc7432b86c5617f2237cc4";
    let s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();